package com.mdb.open.epay.service.epay;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mdb.bc.database.mybatisplus.SuperService;
import com.mdb.open.common.enums.ProductCodeEnum;
import com.mdb.open.epay.common.MdbDataSource;
import com.mdb.open.epay.domain.po.epay.EpFeeConfig;
import com.mdb.open.epay.mapper.epay.EpFeeConfigMapper;
import org.springframework.stereotype.Service;

/**
 * 类描述：
 * 电子支付费用配置表 服务类
 *
 * @author liuyi
 * @date 2019-11-14
 */
@Service
@DS(MdbDataSource.EPAY)
public class EpFeeConfigService extends SuperService<EpFeeConfigMapper, EpFeeConfig> {

    /**
     * 查詢客户费率配置
     */
    public EpFeeConfig getCustomerQpFeeConfig(String customerCode) {
        LambdaQueryWrapper<EpFeeConfig> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(EpFeeConfig::getCustomerCode, customerCode);
        wrapper.eq(EpFeeConfig::getProdCode, ProductCodeEnum.EP_QP.getValue());
        return this.baseMapper.selectOne(wrapper);
    }

}
